{% extends '../search_result.html' %}

{% block page_title %}网站管理{% endblock page_title %}

{% block navbar_status %}
                <li class="active"><a href="#">网站管理<span class="sr-only">(current)</span></a></li>
                <li><a type="submit" href="/community/group" target="_blank">社区</a></li>
                <li><a type="submit" href="/community/question/?q=11" target="_blank">Github</a></li>
{% endblock navbar_status %}
{% block main_div %}
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" style="text-align: center;">
{% if errormsg != None %}
<div class="alert alert-danger alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>ERROR:</strong> {{ errormsg }}
</div>
{% elif msg != None %}
<div class="alert alert-success alert-dismissible" role="alert">
  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  <strong>Message:</strong> {{ msg }}
</div>  
{% endif %}
</div>
</div>
<div class="col-xs-2">
  <div id="menu-list" class="list-group">
    <button id="/webadmin/requests_history/" type="button" class="list-group-item" onclick="drop('/webadmin/requests_history/')">访问记录</button> 
    <button id="/webadmin/docfiles/" type="button" class="list-group-item" onclick="drop('/webadmin/docfiles/')">Docfiles</button> 
<script>
$(function () {
  $('[data-toggle="popover"]').popover()
})
</script>

  </div>
</div>
<div class="col-xs-10" style="height:100%;">
<iframe id="admin-main-window" name="admin-show-window" width="100%" height="100%" src="/webadmin/requests_history/" frameborder="0" scrolling="auto"></iframe>
</div>
<script>
    function drop (target) {
      var frame=$('#admin-main-window').attr('src', target);
      for (index = 0; index < $('#menu-list')[0].childNodes.length; index++) {
      var element = $('#menu-list')[0].childNodes[index];
      if (element.tagName=="BUTTON") {
        if (element.id!=$('#admin-main-window').attr('src')) {
          $(element).attr('class', 'list-group-item');
        }
        else {
          $(element).attr('class', 'list-group-item disabled');
        }
      }
    }
    }
    for (index = 0; index < $('#menu-list')[0].childNodes.length; index++) {
      var element = $('#menu-list')[0].childNodes[index];
      if (element.tagName=="BUTTON") {
        if (element.id!=$('#admin-main-window').attr('src')) {
          $(element).attr('class', 'list-group-item');
        }
        else {
          $(element).attr('class', 'list-group-item disabled');
        }
      }
    }
</script>

{% endblock main_div %}